LameTalk: The LameCard Syntax


LameTalk Keywords

  • lameversion

  • windowhandle

  • stackdata

  • endstackdata

  • stacktitle

  • stackwidth

  • stackheight

  • newcard

  • endcard

  • cardname

  • statictext

  • button

  • staticfile

  • graphicbox

  • endlamecard

  • Return to LameCard article

    As shown by the sidebar on the right, the list of LameCard keywords is short and sweet. Additionally, the syntactical rules closely parallel those of Liberty BASIC, though they tend to be somewhat simpler.

    In general, there are four types of keywords: stack setup commands, card setup commands, control commands, and one miscellaneous command. All will be discussed below.

    Stack Setup Commands

    The stack setup commands establish conditions that apply to the application as a whole, rather than to any single card in the application.

    stackdata

    The stackdata command occurs on a line by itself. It requires no parameters or arguements. stackdata essentially informs the LameCard Interpreter that a series of stack setup commands is to follow.

    endstackdata

    The endstackdata command also occurs on a line by itself. Like stackdata, it requires no parameters or arguements. endstackdata informs the LameCard Insterpreter that the series of stack setup commands has now concluded. At this time, the LameCard Interpreter doesn't enforce the use of endstackdata. However, I like to use it to indicate a clear closure to the stack setup commands.

    Note: all other stack setup commands should be placed between stackdata and endstackdata in a LameTalk source file.

    lameversion version_number

    The lameversion command informs the LameCard Interpreter which set of syntactical rules should be used to evaluate the LameTalk source file. Currently, there is only one version of LameTalk. However, there could be subsequent versions, in which case the lameversion command would be critical. At this time, the LameTalk programmer should use "1" or "1.0" as the parameter for the lameversion command.

    windowhandle handle

    The windowhandle command provides the LameCard Interpreter with a handle name for the Liberty BASIC window. When LameTalk is converted to Liberty BASIC syntax by the LameCard Interpreter, all control definitions will use handle.

    stacktitle "String inside quotes"

    The stacktitle command provides the title string that is used in the title bar of the LameCard application. The interpreter will capture the string inside the quotes and use it in the following command:

    
          Open "String inside quotes" for window as handle
    
    

    stackwidth width_in_pixels

    The stackwidth command tells the LameCard Interpreter what the width of the application window shall be. The width_in_pixels arguement is used in the Liberty BASIC windowwidth command.

    stackheight height_in_pixels

    The stackwidth command tells the LameCard Interpreter what the height of the application window shall be. The height_in_pixels arguement is used in the Liberty BASIC windowheight command.

    Card Setup Commands

    There are only three card setup commands: newcard, cardname and endcard.

    The first two commands are used at the beginning and end of a card defintion. In between newcard and endcard, the LameTalk programmer will provide the card a name using the cardname command. Then, the programmer will place control commands as discussed in the next section. Finally, a card's definition will conclude with an endcard command.

    newcard

    The newcard command occurs on a line by itself and requires no parameters. The command informs the LameCard Interpreter that the controls defined below will belong to the card currently being defined.

    cardname [name.of.card]

    The cardname command requires one parameter, which is essentially a branch label. All controls defined subsequent to a cardname command will belong to the card identified by this branch label.

    endcard

    The endcard command occurs on a line by itself and requires no parameters. It can be used to formally mark the end of a card definition. However, the LameCard Interpreter doesn't enforce the use of the command. In my examples, however, I will always use it.

    Control Commands

    LameTalk Version 1.0 only recognizes four different controls: statictext, staticfiles, buttons and graphicboxes. However, once a LameTalk source file has been converted to Liberty BASIC syntax by the LameCard Interpreter, all LB controls and resources are available in the revised file.

    statictext "contents" xpos ypos wide high

    The statictext command defines a statictext control on the current card. Note that it is very similar to standard Liberty BASIC syntax except that no handle is given to the statictext control, and commas are not used between parameters.

    staticfile "testfile.txt" xpos ypos wide high

    The staticfile command creates a statictext control, but places the contents of a text file within the control. The text file is identified by the parameter "testfile.txt". The textfile testfile.txt must reside in the same directory as the LameTalk source file. This command was created so that large text blocks could be placed within statictext controls. Naturally, the LameTalk programmer will need to make wide and high large enough to accomodate all of the text in testfile.txt.

    button "button label" [destination] xpos ypos wide high

    The button command defines a button control which will reside on the current card. Note that it is very similar to standard Liberty BASIC syntax for buttons, except that no handle is given to the button control, and commas are not used between parameters.

    In "Pure LameCard", a button can only do one of two things. It can either navigate to a new card elsewhere in the stack, or it can quit the application.

    If your button is used to navigate to a new card, then the [destination] parameter must be the name of another card in the stack. If your button is being used to quit the application, then the progammer must make [exitlamecard] the branch label as the destination. An example is given below:

        button "Quit"  [exitlamecard]  400  330  75  35
    

    As indicated elsewhere, once a LameTalk file has been converted to LB source code, then buttons can be made to do anything that Liberty BASIC allows. It's only in Pure LameCard that the function of buttons is limited.

    graphicbox "bitmapname.bmp" xpos ypos wide high

    The graphicbox command defines a graphicbox for the current card, and also identifies a bitmap that will be loaded into the graphicbox when the card appears. Note again that the graphicbox does not have a handle. A handle for the control will be assigned by the LameCard Interpreter during the conversion process.

    The bitmap that will be loaded into the graphicbox control must reside in the same folder as the LameTalk source file.

    Miscellaneous Command

    endlamecard

    The endlamecard command is used to mark the end of the LameTalk source file. With version 1 of LameTalk, the Interpreter recognizes endlamecard, but does not enforce the use of endlamecard.


    Return to LameCard article